<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/mytable/Fk_yusuan.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mytable/mytable/Fk_yusuan.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ys_id',
                footer: "Foots",
                cnName: '预算表编制',
                name: 'mytable/Fk_yusuan',
                url: "/Fk_yusuan/",
                sortName: "ys_id"
            });
            const editFormFields = ref({"gjahr":"","racct":"","rcntr":"","tsl01":"","tsl02":"","tsl03":"","tsl04":"","tsl05":"","tsl06":"","tsl07":"","tsl08":"","tsl09":"","tsl10":"","tsl11":"","tsl12":"","zk_depid":[],"kyed":""});
            const editFormOptions = ref([[{"title":"年度","field":"gjahr","type":"number"},
                               {"dataKey":"fei_typelist","data":[],"title":"科目","field":"racct","type":"select"},
                               {"dataKey":"cntr_all","data":[],"title":"成本中心/研发项目","field":"rcntr","type":"select"},
                               {"title":"1月","field":"tsl01","type":"decimal"},
                               {"title":"2月","field":"tsl02","type":"decimal"}],
                              [{"title":"3月","field":"tsl03","type":"decimal"},
                               {"title":"4月","field":"tsl04","type":"decimal"},
                               {"title":"5月","field":"tsl05","type":"decimal"},
                               {"title":"6月","field":"tsl06","type":"decimal"}],
                              [{"title":"7月","field":"tsl07","type":"decimal"},
                               {"title":"8月","field":"tsl08","type":"decimal"},
                               {"title":"9月","field":"tsl09","type":"decimal"},
                               {"title":"10月","field":"tsl10","type":"decimal"}],
                              [{"title":"11月","field":"tsl11","type":"decimal"},
                               {"title":"12月","field":"tsl12","type":"decimal"},
                               {"dataKey":"tree_department","data":[],"title":"主控部门","field":"zk_depid","type":"cascader"},
                               {"title":"可用额度","field":"kyed","disabled":true,"type":"decimal"}]]);
            const searchFormFields = ref({"gjahr":"","racct":[],"rcntr":[],"zk_depid":[],"kyed":[null,null]});
            const searchFormOptions = ref([[{"title":"年度","field":"gjahr","type":"text"},{"dataKey":"fei_typelist","data":[],"title":"科目","field":"racct","type":"selectList"},{"dataKey":"cntr_all","data":[],"title":"成本中心/研发项目","field":"rcntr","type":"selectList"}],[{"dataKey":"tree_department","data":[],"title":"主控部门","field":"zk_depid","type":"cascader"},{"title":"可用额度","field":"kyed","type":"range"}]]);
            const columns = ref([{field:'ys_id',title:'id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'gjahr',title:'年度',type:'int',link:true,width:80,align:'left',sort:true},
                       {field:'racct',title:'科目',type:'string',bind:{ key:'fei_typelist',data:[]},width:220,align:'left'},
                       {field:'rcntr',title:'成本中心/研发项目',type:'string',bind:{ key:'cntr_all',data:[]},width:220,align:'left'},
                       {field:'tsl01',title:'1月',type:'decimal',width:110,align:'left'},
                       {field:'tsl02',title:'2月',type:'decimal',width:110,align:'left'},
                       {field:'tsl03',title:'3月',type:'decimal',width:110,align:'left'},
                       {field:'tsl04',title:'4月',type:'decimal',width:110,align:'left'},
                       {field:'tsl05',title:'5月',type:'decimal',width:110,align:'left'},
                       {field:'tsl06',title:'6月',type:'decimal',width:110,align:'left'},
                       {field:'tsl07',title:'7月',type:'decimal',width:110,align:'left'},
                       {field:'tsl08',title:'8月',type:'decimal',width:110,align:'left'},
                       {field:'tsl09',title:'9月',type:'decimal',width:110,align:'left'},
                       {field:'tsl10',title:'10月',type:'decimal',width:110,align:'left'},
                       {field:'tsl11',title:'11月',type:'decimal',width:110,align:'left'},
                       {field:'tsl12',title:'12月',type:'decimal',width:110,align:'left'},
                       {field:'ls_type',title:'预算类型1=正常，0=调整',type:'int',width:110,hidden:true,align:'left'},
                       {field:'zk_depid',title:'主控部门',type:'int',bind:{ key:'tree_department',data:[]},width:110,hidden:true,align:'left'},
                       {field:'kyed',title:'可用额度',type:'decimal',width:110,readonly:true,align:'left'}]);
            const detail = ref({
                cnName: "预算项目明细",
                table: "Fk_ysxm",
                columns: [{field:'ys_id',title:'预算编号',type:'int',width:110,require:true,align:'left',sort:true},
                       {field:'xm_name',title:'项目名称',type:'string',width:110,edit:{type:'text'},align:'left'},
                       {field:'tsl01',title:'1月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl02',title:'2月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl03',title:'3月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl04',title:'4月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl05',title:'5月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl06',title:'6月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl07',title:'7月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl08',title:'8月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl09',title:'9月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl10',title:'10月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl11',title:'11月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'tsl12',title:'12月',type:'decimal',width:110,edit:{type:'decimal'},align:'left'}],
                sortName: "ysxm_id",
                key: "ysxm_id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
